Electronic control system for vehicle

ABSTRACT

An electronic control unit performs self-diagnosis based on signals received from various sensors, and stores abnormality data in an EEPROM when abnormality is detected. The DTC is stored in a first memory area and a second memory area of the EEPROM, if a condition flag stored in the EEPROM is OFF and ON, respectively. The condition flag is switched from OFF (initial value) to ON, when service start data is received from a telematics service center in a period from the completion of assembling the electronic control unit to the vehicle to the start of use of the vehicle by a user.

CROSS REFERENCE TO RELATED APPLICATION

This application is based on and incorporates herein by referenceJapanese Patent Application No. 2008-112626 filed on Apr. 23, 2008.

FIELD OF THE INVENTION

The present invention relates to an electronic control system forvehicle that stores as diagnosis result abnormality data in a rewritablenon-volatile memory.

An electronic control system, which is mounted in a vehicle and controlsvarious equipment such as an engine, performs a diagnosis (determinationof normality or abnormality) about various check items based on data(information) from sensors mounted in the vehicle. If any abnormality isdetermined, abnormality data (diagnostic trouble code DTC or fault code)indicating a diagnosis result of abnormality is stored in a rewritablenon-volatile memory such as an electrically erasable programmable readonly memory (EEPROM) or the like.

This electronic control system is sometimes operated in the course ofmanufacturing a vehicle, that is, before all of peripheral devices suchas sensors and actuators have been completely assembled. If thediagnosis is performed with the electronic control system being in suchincompletely-mounted state, abnormality will be detected. Thisabnormality data will be stored in the rewritable non-volatile memory,although such abnormality data is nothing but data of abnormalitydetected in the course of manufacturing the vehicle before theelectronic control system has been completely mounted in the vehicle.

If the user who bought the vehicle brings it to a repair shop or thelike, a shop mechanic will read out such abnormality data from therewritable non-volatile memory by using a failure diagnosis device. Themechanic will misunderstand that the vehicle is abnormal although it isin fact not so. Thus, the abnormality data produced before theelectronic control system has been completely mounted in the vehicle isnot necessary in the normal vehicle check process in the market.

It is therefore proposed in JP 2006-291730A not to store the abnormalitydata produced before the electronic control system is completelymounted. In this proposed system, it is checked whether the vehicle isin a specified condition indicating that it has been sold and is used bya user, and storing a diagnosis result in a memory is allowed only afterthe specified condition is satisfied.

According to this proposed system, it is not possible to later refer toabnormality data indicating abnormality detected in the assembling ofsuch an electronic control system to a vehicle.

It should further be noted that, with regard to vehicle diagnosis, theregulation of the California Air Resources Board (CARB) requires thatany diagnostic trouble code (DTC) that has been stored as a confirmedfault code based on diagnosis result must be kept stored in a rewritablenon-volatile memory such as EEPROM of an electronic control unit (ECU)as a permanent failure code, such as a permanent diagnostic trouble code(PDTC). In order to prevent tampering and concealment of, for example,potential exhaust emissions failures, the regulation also stipulatesthat the PDTC must not be erasable by a command from an external toolcapable of communicating with the ECU.

SUMMARY OF THE INVENTION

It is therefore an object of the present invention to provide anelectronic control system, which separately stores in a rewritablenon-volatile memory abnormality data indicating abnormality detectedbefore a specified condition is satisfied after being assembled to avehicle and abnormality data indicating abnormality detected after thespecified condition is satisfied.

According to the present invention, an electronic control system for avehicle has an electronic control unit including a non-volatile memory,which is rewritable with data in a plurality of memory areas thereof.The electronic control unit is configured to perform diagnosis based ondata from devices mounted on the vehicle and store in the non-volatilememory the detected abnormality data.

In one aspect, the electronic control unit is configured to checkwhether a specified condition is satisfied, and switch the memory areaof the abnormality data based on the check result. The specifiedcondition is set to be after assembling the electronic control unit tothe vehicle and before the use of the vehicle by a user.

In another aspect, the electronic control unit is configured to beoperable in a function check mode for performing a function checkingoperation and a normal mode for performing a normal operation, andswitch the memory area of the non-volatile memory for storing theabnormality data based on whether the function check mode or the normalmode is performed when the abnormality is detected.

In a further aspect, the electronic control unit is configured to switchthe memory area for storing the abnormality data based on a commandreceived from an external tool.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other objects, features and advantages of the presentinvention will become more apparent from the following detaileddescription made with reference to the accompanying drawings. In thedrawings:

FIG. 1 is a block diagram showing an electronic control system for avehicle including an electronic control unit (ECU) in the firstembodiment;

FIG. 2 is a flowchart showing diagnosis result storage processingexecuted by the ECU in the first embodiment;

FIG. 3 is a schematic diagram showing transmission of service start datafrom a data center to a vehicle in the first embodiment;

FIG. 4 is a flowchart showing service start processing executed by adata processing device of the data center in the first embodiment;

FIG. 5 is a flow chart showing flag set processing executed by the ECUin the first embodiment;

FIG. 6 is a flowchart showing abnormality data output processingexecuted by the ECU in the first embodiment;

FIG. 7 is a schematic diagram showing transmission of communicationstart data from the data center to the vehicle in the second embodiment;

FIG. 8 is a flowchart showing communication start check processingexecuted by the data processing device of the data center in the secondembodiment;

FIG. 9 is a schematic diagram showing transmission of area leaving datafrom the data center to the vehicle in the third embodiment;

FIG. 10 is a flowchart showing position check processing executed by thedata processing device of the data center in the third embodiment;

FIG. 11 is a flowchart showing flag set processing executed by the ECUin the fourth embodiment;

FIG. 12 is a flowchart showing diagnosis result storage processingexecuted by the ECU in the fifth embodiment;

FIG. 13 is a flowchart showing abnormality data output processingexecuted by the ECU in the fifth embodiment;

FIG. 14 is a flowchart showing diagnosis result storage processingexecuted by the ECU in the sixth embodiment;

FIG. 15 is a flowchart showing diagnosis result storage processingexecuted by the ECU in the seventh embodiment;

FIG. 16 is a flowchart showing flag set processing executed by the ECUin the eighth embodiment;

FIGS. 17A and 17B are explanatory diagrams showing use area status andEEPROM area, respectively, in the ninth embodiment;

FIG. 18 is a flowchart showing diagnosis result storage processingexecuted by the ECU in the ninth embodiment; and

FIG. 19 is a flowchart showing the abnormality data output processingexecuted by the ECU in the ninth embodiment.

DETAILED DESCRIPTION OF THE EMBODIMENT

The present invention will be described in detail with reference tovarious exemplary embodiments.

First Embodiment

Referring first to FIG. 1, an electronic control system in accordancewith the first embodiment has an electronic control unit (ECU) 1assembled to a vehicle to control a vehicle engine (not shown) andperform diagnosis.

The ECU 1 includes a central processing unit (CPU) 3, a read only memory(ROM) 5 that stores programs executed by the CPU 3 and data referred toat the time of program execution, a random access memory (RAM) 7 fortemporarily storing data, a standby RAM (SRAM) 9 to which electric power+B is continuously supplied as a back-up power for backing up datastorage even in the event normal electric power is lost, an electricallyerasable programmable read only memory (EEPROM) 11 that is one ofrewritable non-volatile memories, an input circuit 13, and an outputcircuit 15.

Various signals are input into the CPU 3 through the input circuit 13,the signals providing input data for controlling the engine. The varioussignals include an output Pb of an intake pipe pressure sensor, anoutput Ne of an engine revolution sensor, an output Tw of an enginecoolant water temperature sensor, an output O₂ of an oxygen sensor orair-fuel ratio sensor of an exhaust system, an output V of a vehiclespeed sensor, and an output IGN of an ignition switch. The outputcircuit 15 outputs drive signals to various electric loads, which areactuators such as an ignition device, fuel injectors, or a malfunctionindicating light (MIL) according to respective commands from the CPU 3.

The CPU 3 is configured by being programmed to execute calculation forengine control based on various signals that are input to the CPU 3through the input circuit 13, and supply commands to the output circuit15 based on the calculation results, to thereby control the electricloads related to the control of the engine. For example, the CPU 3calculates a valve opening timing and a valve opening period of the fuelinjectors, and supplies a command for driving the injectors to theoutput circuit 15 based on the calculation results, to thereby controlfuel injection into the engine.

The ECU 1 is also equipped with a communication circuit 17 for allowingthe CPU 3 to communicate with other devices that are connected to acommunication line 21 within the vehicle. The other devices may include,for example, a navigation device 23, which is external to the ECU 1. Forexample, the calculation value of a vehicle speed is transmitted fromthe ECU 1 to the navigation device 23. The navigation device 23 includesa radio communication device 25 for communicating with a data processingdevice in a data center 31 provided externally from the vehicle as shownin, for example, FIG. 3. The data center 31 can execute a process forimplementing telematics service for the vehicle in the conventionalmanner.

As will be appreciated, telematics refers generally to informationtransfer to and from a vehicle. While a vehicle telematics system may beused for a number of purposes, including collecting road tolls,intelligent transportation systems, tracking vehicle locations,recovering stolen vehicles, automatic vehicle crash notification,location-driven driver information services, dedicated short rangecommunications DSRC, in-vehicle early warning notification alerts forvehicle accident prevention and the like.

Further, as a failure diagnosis device, an external tool 27 forconducting a failure diagnosis of the vehicle is detachably coupled tothe communication line 21 through a connector 21 a. The external tool 27is a hand-held device having a microcomputer and a display device, ormay be a compact personal computer.

The power supplied to the ECU 1 includes an operation power supplysupplied from an in-vehicle battery (not shown) in association with theoperation of the ignition switch, and a backup power supply thatcontinuously supplies power to the standby RAM 9 from an in-vehiclebattery even when the ignition switch is in the off-position or inactiveposition. The ECU 1 operates upon receiving the operation power supplywhen the ignition switch is turned on or activated. A constant voltagegenerated from the backup power supply by a power supply circuit (notshown) within the ECU 1 continuously supplies power to the standby RAM 9as the data retention power supply.

The CPU 3 is programmed to regularly execute diagnosis result storageprocessing shown in FIG. 2, according to a given time period or at givenintervals. It should be noted that the diagnosis result storageprocessing is performed separately form the normal process forcontrolling the engine. When the execution of the diagnosis resultstorage processing starts, the CPU 3 first executes a diagnosing process(self-diagnosis) for detecting any abnormality at S110. The diagnosisprocessing checks whether any abnormality is present in various parts ofthe vehicle 35 related to signals input from various vehicle devicessuch as sensors, switches and actuators through the input circuit 13based on characteristics associated with the signals. The diagnosisprocessing is executed on a predetermined plurality of abnormalitydetection items. For example, in executing the diagnosis processing fordetecting abnormality of a certain sensor, the CPU 3 checks whether theoutput value of the sensor is normal, by checking whether the outputvalue falls within a predetermined range. If the output value does notfall within the predetermined range, the CPU 3 determines that thesensor is abnormal.

At S120, the CPU 3 checks whether any abnormality detection items havebeen determined as abnormal in the above-described diagnosis processing.If no abnormality detection item has been determined to be abnormal, theCPU 3 ends the diagnosis result storage processing. If an abnormalitydetection item has been determined as abnormal, corresponding to YES atS120, the CPU 3 proceeds to S130, and stores abnormality data(diagnostic trouble code DTC) corresponding to the item that has beendetermined to be abnormal in the standby RAM 9. The DTC refers to adiagnosis result indicating that the item is abnormal. When a certaincondition is met, for example, when the same abnormality is detectedcontinuously for two vehicle trips, the diagnostic trouble code isstored in the standby RAM 9 as a confirmed fault code and themalfunction indicating light MIL is turned on. Each trip may be definedas a period between on-operation and next on-operation of the ignitionswitch for starting an engine.

It is then checked at S140 whether a predetermined specified condition,which is set to occur after the ECU 1 has been completely assembled tothe vehicle, is satisfied. Specifically, a condition flag describedbelow is referred to. It is determined that the specified condition issatisfied, if the condition flag is in the on-state (ON). This conditionflag is initialized to the off-state (OFF) when the ECU 1 ismanufactured, and stored in a predetermined memory area of the EEPROM11.

If it is determined at S140 that the specified condition is notsatisfied, a DTC corresponding to the item determined as being abnormalis stored in the first memory area of the EEPROM 11 at S150. If it isdetermined at S140 that the specified condition is satisfied, the DTCcorresponding to the item determined as being abnormal in the diagnosisprocessing is stored in the second memory area of the EEPROM 11 as aPDTC at S155. The PDTC is a permanent diagnostic trouble code, which isstored in the EEPROM 11 and not erasable by the command from theexternal tool 27. Thus, the memory area for the DTC (PDTC) is switchedby S140. After S150 or S155, the diagnosis result storage processing isended.

The condition flag referred to in S140 is switched from the initialvalue, the off-state to the on-state in the following manner.

As shown in FIG. 3, at the data center 31, a data processing device 33is provided. The data processing device 33 includes a server and acommunication device, and communicates with the radio communicationdevice 25 of a vehicle 35 through a public line for cellular phone.Through communication with the vehicle 35, the data processing device 33collects data such as the present position, operating condition orpresence/absence of a failure from the vehicle 35. In return orresponse, the data processing device 33 transmits road traffic data orguide data of vehicle inspection and maintenance to the vehicle 35 basedon the collected data, so that the data is displayed on the displaydevice of the navigation device 23.

The data center 31 is configured to receive various data from a vehicledealer 37 having a terminal device 39 coupled, for example, to acomputer system. When the vehicle dealer 37 sells the vehicle 35equipped with the ECU 1 to a user, registration data related to thevehicle 35 is input to the terminal device 39 before actual delivery tothe user. The registration data includes, for example, a vehicleidentification number and a registration number associated with thevehicle 35 and further may include the name, residence, phone number,e-mail address, and other information associated with the user. Afterthe input of the registration data into the terminal device 39, theregistration data is transmitted to the data processing device 33through a public line or a dedicated line.

The data processing device 33 is programmed to regularly execute servicestart processing as shown in FIG. 4 according to a given time period. Inthe service start processing, it is first checked at S210 whether theregistration data has been received from the terminal device 39. If theregistration data has not been received, the service start processing isended. If the registration data has been received, the processing isadvanced to S220, and a registering process for storing the receivedregistration data is conducted. Then, at S230, service start dataindicating that the implementation of service has been started andcommunication start data are transmitted to the vehicle 35 associatedwith the registration data received as described above. The servicestart processing is thereafter ended.

In the vehicle 35, the service start data from the data center 31 isreceived by the radio communication device 25. Upon receiving theservice start data from the data center 31, the navigation device 23displays a message on the display device indicating and therebynotifying the user that the telematics service may be enjoyed. When thedata processing device 33 transmits the service start data to thevehicle 35, the service for the vehicle 35 starts.

The navigation device 23 forwards the service start data of the datacenter 31 to the ECU 1 through the communication line 21. If thecondition flag is in the off-state, the CPU 3 performs flag setprocessing shown in FIG. 5 at every given interval.

In the flag set processing, first at S310, it is checked whether theservice start data has been received through the communication line 21.If it is determined that the service start data has not been receivedyet, the flag set processing is ended immediately. If it is determinedthat the service start data has been received, the condition flag in theEEPROM 11 is turned on or rewritten to the on-state at S320. After S320,the flag set processing is ended.

When it is determined that the service start data indicating the startof the telematics service has been transmitted from the data processingdevice 33 to the vehicle 35, it is determined that the specifiedcondition is satisfied and the condition flag is switched from theoff-state to the on-state. If the condition flag is thus switched to theon-state, abnormality is detected by the diagnosis processing (S110) ofFIG. 2 and the DTC of such detected abnormality is stored in the secondmemory area of the EEPROM 11 by switching the memory area from the firstmemory area to the second memory area.

It is possible to modify the first embodiment as follows. The dataprocessing device 33 of the data center 31 transmits a memory areaswitching command for instructing the switching of memory area to theECU 1 together with the service start data at S230 in FIG. 4. Thismemory area switching command is forwarded from the navigation device 23to the ECU 1 through the communication line 21. The CPU 3 checks at S310in FIG. 5 whether the memory area switching command has been received.If it is determined that the switching command has been received, thecondition flag is turned on, that is, switched over and rewritten to theon-state.

Further, when the navigation device 23 receives the service start datafrom the data center 31, the navigation device 23 transmits to the ECU 1notification data indicating that the service start data has beenreceived. The CPU 3 checks at S310 in FIG. 5 whether such notificationdata has been received.

The CPU 3 executes abnormality data output processing shown in FIG. 6 atevery given interval, as processing for responding to a request forreading out the DTC stored in the EEPROM 11 among various commands(requests) indicating requests from the external tool 27.

In the abnormality data output processing, it is checked first at S410whether a PDTC read-out request has been received from the external tool27. This PDTC read-out request is a request for reading out andoutputting the PDTC prescribed by the Regulations from the EEPROM 11 andcorresponds to the read-out request of the abnormality data for thefailure diagnosis. That is, the PDTC read-out request is a request,which a mechanic or a repair person of vehicles (operator of theexternal tool 27) uses at a repair (inspection or maintenance) shop,etc. for the failure diagnosis of vehicles.

If it is determined at S410 that the PDTC read-out request has beenreceived, the DTC (that is, PDTC) stored in the second memory area ofthe EEPROM 11 is read out and transmitted to the external tool 27 atS420.

If it is determined at S410 that the PDTC read-out request has not beenreceived, it is checked at S430 whether a special DTC read-out requesthas been received from the external tool 27. This special DTC read-outrequest is a request used for reading out the DTC of abnormality andchecking the abnormality, which has been detected at S110 in FIG. 2during the assembling of the ECU 1 to the vehicle, that is, before theECU 1 was completely assembled to the vehicle. This corresponds to thespecial abnormality data read-out request.

If it is determined that the special DTC read-out request has not beenreceived, this processing is ended. If it is determined that the specialDTC read-out request has been received, the DTC stored in the firstmemory area of the EEPROM 11 is read out and transmitted to the externaltool 27 at S440. After S420 or S440, the abnormality data outputprocessing is ended.

When the external tool 27 is operated to transmit the PDTC read-outrequest, this read-out request is transmitted to the ECU 1. When thePDTC (DTC stored in the second memory area of the EEPROM 11 in thiscase) is received from the ECU 1, the external tool 27 indicates thePDTC on its display. Similarly, when the external tool 27 is operated totransmit the special DTC read-out request, this read-out request istransmitted to the ECU 1. When the DTC (DTC stored in the first memoryarea in this case) is received from the ECU 1, the external tool 27indicates the DTC on its display.

According to the first embodiment, the DTC of abnormality detected inthe diagnosis processing is stored in the first memory area of theEEPROM 11 until a predetermined time point (timing) when the telematicsservice for the vehicle 35 is started. This timing is in a period fromthe completion of assembling the ECU 1 to the vehicle 35 and the vehicle35 is used by the user. After the start of the telematics service, theDTC is stored in the second memory area of the EEPROM 11. As a result,the DTC of abnormality detected in the course of assembling of the ECU 1to the vehicle and unnecessary to be referred to in the normal vehiclerepair process is stored in the first memory area of the EEPROM 11. TheDTC of abnormality detected after the user started using the vehicle isstored in the second memory area of the EEPROM 11.

Only the PDTC stored in the second memory area is outputted to theexternal tool 27 in response to the DTC read-out request from theexternal tool 27. The DTC produced before the completion of assemblingto the vehicle, that is, during the assembling, is not outputted to theexternal tool 27. As a result, the mechanic of the vehicle will noterroneously determine that the vehicle has abnormality although thevehicle is not abnormal at all. Thus, it is not necessary to erase fromthe EEPROM 11 the DTC produced before the completion of assembling tothe vehicle.

When the special DTC read-out request is transmitted from the externaltool 274 the DTC stored in the first memory area is outputted to theexternal tool 27. The operator of the external tool 27 can check anyabnormality detected during the assembling process, that is, before thecompletion of assembling of the ECU 1 to the vehicle, by referring tothis DTC.

The DTC produced before the completion of assembling the ECU 1 to thevehicle is also stored in the standby RAM 9 at S130 in FIG. 2. If thepower supply to the standby RAM 9 is interrupted by disconnection of avehicle battery or battery run-down, the contents of storage disappear.The contents of storage of the EEPROM 11 do not disappear even if thepower supply to the standby RAM 9 is interrupted. Therefore, the DTCproduced before the completion of assembling of the ECU 1 to the vehiclecan be surely stored in the first memory area of the EEPROM 11. In FIG.2, the diagnosis processing of S120 operates as diagnosing means and theprocessing of S140 to S155 operate as memory area switching means.

Second Embodiment

In the second embodiment shown in FIGS. 7 and 8, the condition forswitching the condition flag from the off-state to the on-state, thatis, condition for switching the memory area of storing the DTC in theEEPROM 11, is differentiated from that in the first embodiment.

In the second embodiment shown in FIG. 7, a managing device 43 includinga computer is provided in a manufacturing plant 41 of the vehicle 35into which the ECU 1 and the navigation device 23 are assembled.Management data indicating whether the manufacturing of each vehicle 35has been completed is input to the managing device 43. The managingdevice 43 regularly transmits the management data to the data processingdevice 33 through the public line or the dedicated line according to agiven time period or every time the management data is updated. Themanagement data includes, for example, data indicative of the vehicleidentification number and whether the vehicle associated with thevehicle identification number has been completed.

The ECU 1 is programmed to make a periodic access to the data processingdevice 33 each time electric power is supplied to the ECU 1 and theradio communication device 25. The signal that is transmitted at thetime of accessing includes vehicle data such as the vehicleidentification number specific to the vehicle 35.

The data processing device 33 is programmed to execute the communicationstart check processing shown in FIG. 8 every given period. In thecommunication start check processing, it is first checked at S250whether an access has been received from the radio communication device25. If no access has been received, the process is ended. If it isdetermined that the access has been received, the processing is advancedto S260.

In S260, it is checked whether the vehicle 35 that made the access hasbeen completely manufactured, based on the management data that has beenreceived from the managing device 43. More specifically, it is checkedwhether the management data indicative of the completion of manufactureof the vehicle 35 has been received from the managing device 43. If itis determined that the manufacture of the vehicle 35 has not beencompleted, the communication start check processing is ended. If it isdetermined that the manufacture of the vehicle 35 has been completed,the communication start data is transmitted to the vehicle 35 at S270,and the communication start check processing is ended.

In the vehicle 35 to which the communication start data is transmittedfrom the data center 31, the communication start data from the datacenter 31 is transferred from the navigation device 23 to the ECU 1through the communication line 21.

In the ECU 1, at S310 of the flag set processing in FIG. 5, the CPU 3checks whether the communication start data has been received in placeof the service start data. If the communication start data has beenreceived, the CPU 3 switches the condition flag to the on-state at S320.

In the second embodiment, even if the radio communication device 25starts to operate and accesses the data processing device 33 duringmanufacture while not yet completed, the communication start data is nottransmitted from the data processing device 33. When the radiocommunication device 25 accesses the data processing device 33 afterfinal assembly of the vehicle 35 has been completed, the communicationstart data is automatically transmitted from the data processing device33 to the vehicle 35. As a result, the area of storing the DTC in theEEPROM 11 is switched from the first memory area to the second memoryarea.

According to the second embodiment also, the area of storing the DTC inthe EEPROM 11 is switched from the first memory area to the secondmemory area at the special timing between the completion of assemblingof the ECU 1 to the vehicle and the start of use of the vehicle by theuser, more specifically at the timing when the communication between theradio communication device 25 of the vehicle 35 and the data processingdevice 33 is started successfully.

The second embodiment may be modified as follows. The data processingdevice 33 of the data center 31 transmits a request signal requestingthe management data about the vehicle 35 at S260 in FIG. 8, and checkswhether the manufacture of the vehicle 35 has been completed based onthe management data transmitted from the management device 43 inresponse to the request signal.

Third Embodiment

In the third embodiment shown in FIG. 9, the condition for switching thecondition flag from the off-state to the on-state is differentiated fromthat in the first embodiment.

In the third embodiment, a computer in the navigation device 23 isprogrammed to periodically transmit position data indicative of thepresent position of the vehicle 35 to the data processing device 33. Thedata processing device 33 is programmed to regularly execute theposition check processing shown in FIG. 10 according to a given period,that is, at given intervals.

In the position check processing, it is first checked at S280 whetherthe vehicle 35 has moved out of or left a specified region 45 shown inFIG. 9 based on the position data from the vehicle 35. The specifiedregion 45 includes a site or premise of the manufacturing plant wherethe vehicle 35 is manufactured or a portion associated with the site orpremise where vehicles under manufacture are staged or from wherecompleted vehicles are transported or shipped to other places such asvehicle dealers. The vehicle 35 that has moved out of the specifiedregion 45 is a vehicle that has been completed but has not yet beendelivered to and used by a user.

If it is determined that the vehicle 35 has not moved out of thespecified region 45 at S280, the position check processing is ended. Ifit is determined that the vehicle 35 has moved out of the specifiedregion 45, processing is advanced to S290. If it is determined that thevehicle 35 has moved out of the specified region 45 at S290, the arealeaving data is transmitted and the position check processing is ended.

According to the third embodiment also, the area for storing the DTC inthe EEPROM 11 is switched from the first memory area to the secondmemory area at the predetermined timing, which is after the completionof assembling of the ECU 1 to the vehicle and before the use of thevehicle by the user, more specifically at the timing when the vehicle 35leaves the specified area 45. Therefore the same advantage as in thefirst embodiment is provided.

The specified area 45 may be set to a premise of a vehicle dealer, atwhich the vehicle 35 is sold, or a workshop area of the vehicle dealer,at which the old ECU of the vehicle 35 is replaced with a new one.

Modification of Third Embodiment

The third embodiment may be modified such that the navigation device 23of the vehicle 35 executes the similar processing as that of FIG. 10.

Specifically, since the navigation device 23 of the vehicle 35continuously detects the position of the vehicle 35, it may checkwhether the vehicle 35 has moved out of the specified area 45. If it isdetermined that the vehicle 35 has moved out of the specified area, thearea leaving data is transferred to the ECU 1 through the communicationline 21.

Fourth Embodiment

In the fourth embodiment shown in FIG. 11, the CPU 3 executes the flagset processing shown in FIG. 11 and the navigation device 23 regularlytransfers the position of the vehicle 35 to the ECU 1 of the vehicle 35.

In the flag set processing of FIG. 11, it is checked first at S313whether the vehicle 35 has moved out of the specified area 45 (same asin the third embodiment) based on the position information of thenavigation device 23. If it is determined that the vehicle 35 has notyet moved out of the specified area, this flag set processing is ended.If it is determined that the vehicle 35 has moved out of the specifiedarea 45, the condition flag is switched to the on-state thus ending thisprocessing.

Thus, according to the fourth embodiment, the CPU 3 itself checkswhether the vehicle 35 has moved out of the specified area 45 based onthe position data. The fourth embodiment provides the same advantage asthe third embodiment.

Fifth Embodiment

In the fifth embodiment shown in FIGS. 12 and 13, the CPU 3 executesdiagnosis result storage processing shown in FIG. 12 and abnormalitydata output processing shown in FIG. 13 in place of the correspondingprocessing shown in FIG. 2 and FIG. 6, respectively. In the diagnosisresult storage processing of FIG. 12, S145 and S147 are added to thecorresponding processing of FIG. 2.

If it is determined at S140 that the condition flag is in the off-stateand the specified condition is not satisfied, a history flag is set (forexample flag=1) at S145 and the S150 is executed. If it is determined atS140 that the condition flag is in the on-state and the specifiedcondition is satisfied, it is checked at S147 whether the history flaghas been set (flag=1). If the history flag has been set, S155 isexecuted. If the history flag has not been set, S150 is executed. It isnoted here that the history flag is also stored in a predeterminedmemory area (third memory area) in the EEPROM 11 and initialized to theoff-state (OFF) at the time of manufacture of the ECU 1.

In the abnormality data output processing of FIG. 13, S415, S435 andS445 are added to the corresponding processing of FIG. 6.

If it is determined at S410 that the request for reading out the PDTChas been received from the external tool 27, it is checked at S415whether the history flag has been set. If it has been set, S420 isexecuted. If it has not been set, S440 is executed.

If it is determined at S430 that the request for reading out the specialDTC has been received at the external tool 27 it is checked at S435whether the history flag has been set. If the history flag has been set,S440 is executed. If it has not been set, S445 is executed so thatmessage data indicating no DTC is transmitted to the external tool 27,thus ending this processing.

According to the diagnosis result storage processing of FIG. 12, whenthe abnormality is detected by S110 under the condition that thecondition flag has not been set yet (S140: NO), the DTC indicating theabnormality is stored in the first memory area and the history flag isset as the history data (S145, S150). If abnormality is detected by S110after the condition flag has been set (S140: YES), the history flag isreferred to. If the history flag has not been set, the DTC is stored inthe first memory area of the EEPROM 11 (547: NO to S150). If the historyflag has been set, the DTC is stored in the second memory area of theEEPROM 11 (S147: YES to S155).

As a result, if any abnormality has been detected by the diagnosisprocessing before the condition flag is turned on, the DTC producedbefore the turning on of the condition flag is stored in the firstmemory area EEPROM 11 and the DTC produced after the turning on of thecondition flag is stored in the second memory area of the EEPROM 11 asin the first to the fourth embodiments.

If no abnormality has been detected by the diagnosis processing beforethe condition flag is turned on, that is, if the DTC produced before thecondition flag is turned on, the history flag is not turned on.Therefore, the DTC produced after the condition flag has been set isstored in the first memory area of the EEPROM 11. The memory areas ofthe EEPROM 11 can be used efficiently.

For this reason, in the abnormality data output processing of FIG. 13,when the request for reading out the PDTC is received from the externaltool 274 the history flag is referred to. If the history flag has beenset, the DTC in the second memory area of the EEPROM 11 is read out andoutputted to the external tool 27 (S415: YES to S420). If the historyflag has not been set, the DTC in the first memory area of the EEPROM 11is read out and outputted to the external tool 27 (S145: NO to S440).That is, S415 specifies by the history flag the area of storing thePDTC, which is the DTC produced after the condition flag has been setand which should be read out and outputted in response to the PDTCread-out request.

When the special DTC read-out request is received from the external tool274 the history flag is referred to. If the history flag has been set,the DTC stored in the first memory area of the EEPROM 11 is read out andoutputted to the external tool 27 (S435: YES to S440). If it has notbeen set, it means that the relevant DTC (that is, DTC of abnormalitydetected before the completion of assembling the ECU 1 to the vehicle)is not stored in the EEPROM 11. Therefore, the message data indicatingthis is outputted to the external tool 27 (S435: NO to S445).

Sixth Embodiment

In the sixth embodiment, the CPU 3 executes diagnosis result storageprocessing shown in FIG. 14 in place of the corresponding processing ofFIG. 2 of the first embodiment. This processing of FIG. 14 is executedirrespective of the operation mode described below.

Further, the operation mode of the CPU 3 (ECU 1) is switched between thenormal mode for operating normally and a function check mode. Thefunction check mode is a special mode, which is used at the repair shopor the vehicle dealer and provided for checking the function related tothe ECU 1.

In this function check mode, specified loads (for example, lights andindicators, etc. provided on an instrument panel of the vehicle) areforced to operate sequentially for confirming the operations of theloads, or special diagnosis processing stricter than the aboveprocessing with respect to normality determination requirement.

When the CPU 3 receives a function check mode transition command(command for transition to the function check mode) from the externaltool 274 it operates under the function check mode. When a transitioncondition for transition to the normal mode is satisfied, the CPU 3changes its operation mode from the function check mode to the normalmode.

As the condition for transition to the normal mode may be switching ofthe ignition switch from OFF to ON a predetermined number of times,which is set by the external tool, or receiving of a normal modetransition command from the external tool 27. The predetermined numberof times of switching to ON of the ignition switch may be the number oftimes of ON of the ignition switch, which is required in the functioncheck mode. This predetermined number of times may be increased by anadditional number of times (for example, one, two, etc.) inconsideration of the vehicle condition.

For this reason, in the manufacturing plant of the vehicle, the functioncheck mode transition command is applied to the ECU 1 from the externaltool 27 when the ECU 1 has been completely assembled to the vehicle.Thus, the ECU 1 is operated first in the function check mode to checkefficiently whether there is any abnormality. For example, the lights,indicators, etc. are eye-checked by forcedly operating them as describedabove or the diagnosis result of the special diagnosis processing isread out to the external tool 27, thereby to check whether the sensors,switches, etc. are connected normally and operating normally.

If it is confirmed that there is no abnormality, the ECU 1 is switchedfrom the function check mode to the normal mode by satisfying thecondition required for transition to the normal mode, and then thevehicle is shipped form the manufacturing plant. It is likely that thisoperation is performed at the vehicle dealer when a failing ECU isreplaced with a new one. This inspection mode is also referred to as aplant mode.

Therefore, in the diagnosis result storage processing of FIG. 14, thepresent operation mode is checked at S143, which is provided in place ofS140 (FIG. 2). If it is the function check mode, S150 is executed. If itis the normal mode, S155 is executed.

According to the sixth embodiment, if any abnormality is detected by thediagnosis processing in the function check mode, which is considered tobe before the completion of assembling to the vehicle, the DTC is storedin the first memory area of the EEPROM 11. If any abnormality isdetected by the diagnosis processing in the normal mode, which isconsidered to be after the completion of assembling of the ECU 1 to thevehicle, the DTC is stored as the PDTC in the second memory area of theEEPROM 11.

That is, the DTC produced in the function check mode before thecompletion of assembling to the vehicle is stored in the first memoryarea of the EEPROM 11. The DTC produced in the normal mode after thestart of use of the vehicle by the user is stored in the second memoryarea of the EEPROM 11. Therefore, the same advantage is provided as inthe foregoing embodiments.

According to the sixth embodiment, similarly to the first embodiment,the PDTC is outputted to the external tool 27 in response to the PDTCread-out request from the external tool 27. As a result, it is preventedthat the DTC, which is produced in the function check mode but is notnecessary normally at the vehicle maintenance or repair process, isoutputted to the external tool 27 and the mechanic of the vehicleerroneously determines that the vehicle has abnormality. Therefore, theDTC produced in the function check mode need not be erased from theEEPROM 11.

Further, similarly to the first embodiment, the DTC stored in the firstmemory area is outputted to the external tool 27 in response to thespecial DTC read-out request from the external tool 27. As a result, theuser of the external tool 27 can realize the abnormality detected in thefunction check mode of the ECU 1 based on such a DTC.

In the sixth embodiment, S143 to S155 operate as memory area switchingmeans.

Seventh Embodiment

The seventh embodiment shown in FIG. 15 is a combination of the fifthembodiment and the sixth embodiment.

In the seventh embodiment, the CPU 3 switches the operation mode betweenthe normal mode and the function check mode in the similar manner as inthe sixth embodiment. In addition, the CPU 3 executes the diagnosisresult storage processing of FIG. 15 in place of the correspondingprocessing of FIG. 12. The diagnosis result storage processing of FIG.15 is executed irrespective of the operation mode of the CPU 3.

In the processing of FIG. 15, in comparison to that of FIG. 12, it ischecked at S144 in place of S140 whether the operation mode is thefunction check mode. If it is the function check mode, S145 is executed.If it is the normal mode, S147 is executed.

Therefore, when any abnormality is detected (S144: YES) by the diagnosisprocessing of S110 in the function check mode, the history flag is setas the history data (S145) and the DTC indicating this abnormality isstored in the first memory area of the EEPROM 11 (S150). When anyabnormality is detected (S144: NO) by the diagnosis processing of S10 inthe normal mode, the history flag is referred to (S147). If the historyflag has not been set (S147: NO), the DTC is stored in the first memoryarea of the EEPROM 11 (S150). If the history flag has been set (S147:YES), the DTC is stored in the second memory area of the EEPROM 11(S155).

As a result, if the abnormality is detected by the diagnosis processingin the function check mode, the DTC produced in the function check modeis stored in the first memory area of the EEPROM 11 and the DTC producedin the normal mode after the function check mode is stored in the secondmemory area of the EEPROM 11 in the similar manner as in the sixthembodiment. If no abnormality is detected by the diagnosis processing inthe function check mode, no history flag is set. Therefore the DTCproduced in the normal mode is stored in the first memory area of theEEPROM 11. Thus, similarly to the fifth embodiment, the memory area ofthe EEPROM 11 can be used efficiently.

In the seventh embodiment also, the abnormality data output processingof FIG. 13 is executed. In this processing, the memory area for thePDTC, which is the DTC in the normal mode and should be outputted inresponse to the PDTC read-out request, is specified by the history flagat S415 in the case of receiving the PDTC read-out request from theexternal tool 27.

Eighth Embodiment

The eighth embodiment is differentiated from the first embodiment in thefollowing points.

As the external tool 27, a commercially available failure diagnosisdevice (scan tool) is detachably connected to the communication line 21.This scan tool is compatible with the OBD2 specification (code andstandard).

This scan tool is connected to the communication line 21 at, forexample, vehicle dealers, repair shops, maintenance shops and the like,when the failure diagnosis of a vehicle is to be performed. The scantool has the similar function as the external tool 27 used in the firstembodiment, etc.

The scan tool is configured to automatically transmit a command (supportdata inquiry command) to the ECU 1 to confirm the connection with thecommunication tool 21, when it is connected to the communication tool21. This support data inquiry command is for inquiring the types ofdata, which the ECU 1 can output to the scan tool. The support datainquiry command is a series of data of $7DF, $01 and $00. $ is a signindicating that the subsequent numbers are in hexadecimal.

When the ECU 1 receives the support data inquiry command, it transmitsto the scan tool data indicating what types of data are available fromitself as failure diagnosis data, which can be outputted to the scantool. The scan tool displays these types of data on its display in theform of a list or the like. The user of the scan tool can thus recognizefrom the displayed data what types of diagnosis data from the ECU 1.

In the eighth embodiment, the CPU 3 executes flag set processing shownin FIG. 16 in place of the corresponding processing of FIG. 5.

Specifically, it is checked at S315 whether the support data inquirycommand (special command) has been received from the scan tool. If it isdetermined that no such an inquiry command has been received, the flagset processing is ended. If such an inquiry command is received, thecondition flag is turned on to rewrite the flag to the on-state and thisflag set processing is ended.

According to the eighth embodiment, the support data inquiry command(special command) from the scan tool is used as an instruction to switchthe memory area of the DTC similarly to the service start data of thedata center 31 in the first embodiment.

Further, even if the ECU 1 is replaced with a new ECU after the vehicle35 has been shipped into a market or the vehicle 35 has been shippedfrom the manufacturing plant without switching the memory area forstoring the DTC in the EEPROM 11 from the first memory area to thesecond memory area, the memory area for the DTC can be switched from thefirst memory area to the second memory area by connecting the scan toolto the ECU 1.

Thus, immediately before the vehicle 35 equipped with a new replacementECU or a brand new vehicle just shipped from the manufacturing plant isused by a user, the memory area for storing the DTC in the EEPROM 11 canbe readily switched from the first memory area to the second memoryarea.

By simply connecting the scan tool to the communication line 21 of thevehicle 35 without special additional manipulations, the memory area forthe DTC can be switched. As a result, it is prevented that the switchingof the memory area for the DTC will not be performed due to forgettingor failure of the manipulation.

Ninth Embodiment

The ninth embodiment is differentiated from the first embodiment in thefollowing points.

In this embodiment, each memory area of the EEPROM 11 for storing theDTC is indicated as EEPROM areas (0) to (*) as shown in FIG. 17B. “*” isan integer which is smaller than the number of total memory areas of theEEPROM by 1.

As shown in FIG. 17A, a use area status, which indicates the memory areaof the DTC, is stored in a predetermined memory area of the EEPROM 11.For example, if the use area status values are 0 and 1, it indicatesthat the EEPROM area (0) and the EEPROM area (1) are for storing theDTC. The initial value of the use area status value is 0, at the time ofthe completion of manufacture of the ECU 1.

The CPU 3 is configured to switch the use area status value in responseto a switching command from the external tool 27. Specifically, theexternal tool 27 transmits the switching command to the ECU 1 when apredetermined operation is performed. The CPU 3 checks whether theswitching command has been received from the external tool 27. The CPU 3increases the use area status value by 1.

The CPU 3 further executes diagnosis result storage processing shown inFIG. 18 in place of the corresponding processing of FIG. 2. In thediagnosis result storage processing of FIG. 18, S160 and S170 areexecuted in place of S140 to S155 of FIG. 2.

Specifically, at S160 following S130, the use area status is read in atS160. At the following S170, the DTC corresponding to the itemdetermined to be abnormal by the present diagnosis processing (S110) isstored in one EEPROM area indicated by the use area status among theEEPROM areas (0) to (*), thus ending the diagnosis result storageprocessing.

In the diagnosis result storage processing of FIG. 18, no condition flagis referred to, and hence the CPU 3 does not execute flag set processingof FIG. 5.

According to the ninth embodiment, by transmitting the switching commandfrom the external tool 27, the memory area of the EEPROM 11 for storingthe DTC can be sequentially changed in the order from the EEPROM area(0), EEPROM (1), EEPROM (2) and the like.

According to the ninth embodiment, at the predetermined specified timingbetween the completion of assembling the ECU 1 to the vehicle and theshipment of the vehicle (for example, at the time of completion of themanufacture or shipment of the vehicle) in the vehicle manufacturingplant, the switching command is applied from the external tool 27 to theECU 1 to update the use area status value from 0 to 1 and update the usearea status value from 0 to 1. Thus, the memory area for the DTC isswitched from the EEPROM area (0) to the EEPROM area (1). As a result,the DTC produced before the shipment of the vehicle from themanufacturing plant is stored in the EEPROM area (0), and the DTCproduced after the start of use of the vehicle by the user is stored inthe EEPROM area (1).

According to the ninth embodiment, the external tool 27 is configured totransmit the switching command to the ECU 1 to update the use areastatus value from 1 to 2, when the program to be executed by the CPU 3is rewritten after the vehicle has been shipped from the manufacturingplant. As a result, the memory area for the DTC is switched from theEEPROM area (1) to the EEPROM area (2). Therefore, the DTC produced bythe new program after rewriting can be stored in the EEPROM area (2),which is separate from the EEPROM area (1) storing the DTC produced bythe old program before the program rewriting.

The CPU 3 thus executes abnormality data output processing shown in FIG.19 in place of the corresponding processing of FIG. 6.

In the abnormality data output processing of FIG. 19, it is checked atS510 whether the PDTC read-out request from the external tool 27 hasbeen received. If it is determined that the PDTC read-out request hasbeen received, it is checked at S520 whether the use area status valueis 0.

If the status value is 0, it means that the vehicle equipped with theECU 1 has not been shipped yet from the manufacturing plant and hence noDTC has been produced after the user started to use the vehicle.Therefore, a message data indicating no DTC, that is, there is no DTC tobe transmitted in response to the PDTC read-out request, is transmittedto the external tool 27 at S530, thus ending the abnormality data outputprocessing.

If it is determined that the use area status value is not 0, the DTCstored in the EEPROM area indicated by the status value among the EEPROMareas (0) to (*) is read out and transmitted to the external tool 27 atS540, thus ending the abnormality data output processing.

Thus, when the ECU 1 receives the PDTC read-out request after thevehicle has been shipped from the plant, the DTC is read out from theEEPROM area indicated as the memory area for the DTC at that time pointand transmitted as the PDTC to the external tool 27.

If it is determined at S510 that the PDTC read-out request has not beenreceived, it is checked at S550 whether the special DTC read-out requesthas been received from the external tool 27. If it is determined at S150that the special DTC read-out request has not been received, thisabnormality information output processing is ended. If it is determinedthat the special DTC read-out request has been received, the DTC storedin the EEPROM area (0) is read out and transmitted to the external toolat S560, thus ending the abnormality data output processing. This DTC inthe EEPROM area (0) is the DTC, which has been produced before thevehicle was shipped from the manufacturing plant and corresponds toabnormality detected in the assembling work of the ECU 1 to the vehicle.

The ninth embodiment provides the similar advantage as the firstembodiment. In the ninth embodiment, S160 and S170 operate asabnormality data holding means. The use area status corresponds todetermination data.

If it is likely that the operation mode of the ECU 1 is changed to thefunction check mode after shipment from the manufacturing plant, thefollowing modification may be implemented.

(First Modification)

As the first modification, the use area status value is automaticallyincreased by 1, when the operation mode is switched from the normal modeto the function check mode. Further, when the operation mode is returnedfrom the function check mode to the normal mode, the use area statusvalue of the function check mode is stored in a predetermined area R ofthe EEPROM 11 and the use area status value is returned to the previousvalue present before switching to the function check mode.

When the switching command is received from the external tool 27thereafter, for example, when the program of the ECU 1 is rewritten, theuse area status value is changed to a minimum value, which is other thanthe value of the function check mode stored in the predetermined area Rand a minimum among values greater than the present value. For example,the use area status value is changed from 2 to 4, if the present valueof the use area status is 2 and the value stored in the predeterminedarea R is 3.

In addition, the CPU 3 is configured to read out the DTC and output itto the external tool 27 at S540 in FIG. 19. This DTC is stored in theEEPROM area indicated by a value, which is other than the value storedin the predetermined area R and maximum among values of already-set usearea status.

The CPU 3 is configured to read out the DTC from the EEPROM area (0) andtransmit it to the external tool 27 at S560 in FIG. 19, if no value isstored in the predetermined area R. If any value is stored in thepredetermined area R, the DTC is read out from the EEPROM area indicatedby such a value (and also from the EEPROM area (0)) and transmitted tothe external tool 27.

The CPU 3 may also be configured to automatically increase the use areastatus value by 1 when the operation mode is returned from the functioncheck mode to the normal mode, without returning it to the previousvalue present before switching to the function check mode. The change ofthe use area status at the time of switching of the operation mode neednot be performed automatically, but may be performed by generating theswitching command from the external tool 27.

(Second Modification)

The CPU 1 may be configured to automatically set the use area statusvalue to 0 at the time of switching from the normal mode to the functioncheck mode, and thereafter return the status value to the previous valuepresent before switching to the function check mode at the time ofreturning from the function check mode to the normal mode. The statusvalue may be set to a value which is greater than the previous value by1.

(Third Modification)

In the third modification, which is a modification of the ninthembodiment, the external tool 27 is configured to transmit to the ECU 1a switching command including a value designated by any one of 0 to * byexternal operation. The CPU 3 is configured to set the use area statusvalue to the value designated by the received switching command, when itis determined that the switching command has been received.

That is, it is possible to arbitrarily change the use area status value(EEPROM area in which the DTC is to be stored) by the switching commandfrom the external tool 27.

In this example as well, the use area status value is changed from 0 to1 at the specified timing (completion of manufacture or shipment ofvehicle) in the vehicle manufacturing plant in response to the switchingcommand from the external tool 27 to the ECU 1. If the program of theECU 1 is rewritten thereafter, the use area status value is changed from1 to 2.

If it is likely that the operation mode of the ECU 1 is switched to thefunction check mode after the vehicle has been put into the market, theuse area status value is changed to 0 in response to the switchingcommand from the external tool 27 to the ECU 1. When the operation modeis returned to the normal mode, the status value is returned to theprevious value present before the change to 0 or the value greater thanthe previous value by 1 in response to the switching command from theexternal tool 27 to the ECU 1.

If the CPU 3 is configured to output the use area status value to theexternal tool 27 in response to the request from the external tool 274the present value of the use area status in the ECU 1 can be readily andsurely recognized by the external tool 27.

The present invention is not limited to the above embodiments andmodifications but may be implemented in many other ways.

For example, the DTC stored in the EEPROM 11 as non-PTDC need not beread out, even if the special read-out request is received from theexternal tool 27. Such stored DTC, which is not PDTC, may be read outdirectly from the EEPROM 11 by disconnecting or separating the EEPROM 11from the ECU 1.

It is possible to erase the DTC stored in the first memory area of thenon-volatile memory (EEPROM 11) at the time of or after switching thememory area for storing the DTC from the first memory area to the secondmemory area of the non-volatile memory, thereby reducing the memoryareas required for the DTC.

The non-volatile memory is normally used to store not only the DTC(PDTC) but also other data that should be continuously maintained. Suchother data include learning value for engine control, or certificationnumber or personal identification number of a vehicle security system,and the like. The first memory area of the non-volatile memory can beused most efficiently after switching the memory area.

1. An electronic control system for a vehicle comprising: a non-volatilememory assembled to the vehicle and rewritable with data in a pluralityof memory areas thereof; diagnosis means configured to perform diagnosisbased on data from devices mounted on the vehicle; and memory areaswitching means configured to store in the non-volatile memoryabnormality data detected by the diagnosis means, wherein the memoryarea switching means is configured to check whether a specifiedcondition is satisfied, and switch the memory area of the abnormalitydata based on a check result, the specified condition being set to beafter assembling the non-volatile memory, the diagnosis means and thememory area switching means to the vehicle.
 2. The electronic controlsystem according to claim 1, wherein the memory area switching means isconfigured to store the abnormality data in a first memory area and asecond memory area of the plurality of memory areas of the non-volatilememory, when the abnormality is detected before and after the specifiedcondition is satisfied, respectively.
 3. The electronic control systemaccording to claim 1, wherein: the memory area switching means isconfigured to store the abnormality data in a first memory area of theplurality of memory areas of the non-volatile memory and set a historydata, at time the abnormality is detected before the specified conditionis satisfied; and the memory area switching means is configured to storethe abnormality data in the first memory area and a second memory area,when the history data is not set and is set, respectively, at time theabnormality is detected after the specified condition is satisfied. 4.The electronic control system according to claim 1, wherein thenon-volatile memory is configured to store data indicating a memory areaof the plurality of memory areas of the non-volatile memory in which theabnormality data of abnormality detected after the specified conditionis satisfied.
 5. An electronic control system for a vehicle comprising:a non-volatile memory assembled to the vehicle and rewritable with datain a plurality of memory areas thereof; diagnosis means configured toperform diagnosis based on data from devices mounted on the vehicle; andmemory area switching means configured to store in the non-volatilememory abnormality data detected by the diagnosis means, wherein thediagnosis means is configured to be operable in a function check modefor performing a function checking operation and a normal mode forperforming a normal operation, and wherein the memory area switchingmeans is configured to switch the memory area of the non-volatile memoryfor storing the abnormality data based on whether the function checkmode or the normal mode is performed when the abnormality is detected.6. The electronic control system according to claim 5, wherein thememory area switching means is configured to store the abnormality datain a first memory area and a second memory area of the plurality ofmemory areas of the non-volatile memory, when the abnormality isdetected in the function check mode and the normal mode, respectively.7. The electronic control system according to claim 5, wherein: thememory area switching means is configured to store the abnormality datain a first memory area of the plurality of the memory areas of thenon-volatile memory and set a history data, when the abnormality isdetected in the function check mode; and the memory area switching meansis configured to store the abnormality data in the first memory area anda second memory area of the plurality of the memory areas of thenon-volatile memory, when the history data is not set and is set at timethe abnormality is detected in the normal mode, respectively.
 8. Theelectronic control system according to claim 5, wherein the non-volatilememory is configured to store data indicating a memory area of theplurality of memory areas of the non-volatile memory in which theabnormality data of abnormality detected in the normal mode is stored.9. An electronic control system for a vehicle comprising: a non-volatilememory assembled to the vehicle and rewritable with data in a pluralityof memory areas thereof; diagnosis means configured to perform diagnosisbased on data from devices mounted on the vehicle; and memory areaswitching means configured to store in the non-volatile memoryabnormality data detected by the diagnosis means, wherein the memoryarea switching means is configured to switch the memory area for storingthe abnormality data based on a command received from an external tool.10. The electronic control system according to claim 9, wherein thenon-volatile memory is configured to store data indicating a memory areaof the plurality of memory area of the non-volatile memory in which theabnormality data to be outputted to the external tool in response to arequest for reading out the abnormality data from the external tool.